<?php
defined("_VALID_ACCESS") || die('Direct access forbidden');
    class Eyeworx_Inventory_SolutionsImport_RBO_RBOSolutionsImport extends RBO_Recordset {

//        public function display_total($record, $nolink=false) {
//            if (is_array($record)) {
//                $record = record_to_object($record);
//            }
//            $total = $record['total'] = $record['quantity'] * $record['price'];
//            $price_currency =  Utils_CurrencyFieldCommon::get_values($record->total);
//            return Utils_CurrencyFieldCommon::format(round($total,2),$price_currency[1]);
//        }

        public function fields() {
            $fields = array();

            $acc = new RBO_Field_Select('Solution', 'eyeworx_solutions', array('solution_brand', 'solution_model'));
            $acc->set_visible()->set_required();
            $fields[] = $acc;

            $expiration = new RBO_Field_Date('Date of Expiration');
            $expiration->set_required()->set_visible();
            $fields[] = $expiration;

            $date = new RBO_Field_Date('Date Imported');
            $date->set_required()->set_visible();
            $fields[] = $date;

            $quantity = new RBO_Field_Integer('Quantity');
            $quantity->set_required()->set_visible();
            $fields[] = $quantity;

            return $fields;
        }

        public function table_name() {
            return 'eyeworx_solutions_import';
        }

    }
?>